<template>
  <Sidebar>
    <div class="sidebar-title flex align-items-center">
      <div class="title-icon shrink-0">
        <svg-icon icon-name="gitlab_user" class-name="s24"></svg-icon>
      </div>
      <span class="m-l-10 title collapse-hide">网站管理</span>
    </div>
    <el-menu class="sidebar a-link-item" :default-active="activeIndex">
      <el-menu-item class="sidebar-item" :index="$rp.ANNOUNCEMENTS">
        <router-link :to="`/${$rp.ADMIN}/${$rp.ANNOUNCEMENTS}`">
          <svg-icon icon-name="sprite_icons_bullhorn"/>
          <span class="m-l-10 collapse-hide">平台公告</span>
        </router-link>
      </el-menu-item>
      <el-menu-item class="sidebar-item" :index="$rp.COMMUNITIES">
        <router-link :to="`/${$rp.ADMIN}/${$rp.COMMUNITIES}`">
          <svg-icon icon-name="pod"/>
          <span class="m-l-10 collapse-hide">社区管理</span>
        </router-link>
      </el-menu-item>
      <el-menu-item class="sidebar-item" :index="$rp.APPLICATION_FOR_PUBLIC_SPACES">
        <router-link :to="`/${$rp.ADMIN}/${$rp.APPLICATION_FOR_PUBLIC_SPACES}`">
          <svg-icon icon-name="sprite_icons_review-list"/>
          <span class="m-l-10 collapse-hide">申请公开的空间</span>
        </router-link>
      </el-menu-item>
      <el-menu-item class="sidebar-item" index="popularize_info">
        <router-link to="/admin/popularize_info">
          <svg-icon icon-name="" />
          <span class="m-l-10 collapse-hide">推广情况统计</span>
        </router-link>
      </el-menu-item>
    </el-menu>
  </Sidebar>
</template>

<script>
import Sidebar from '@/components/shared/Sidebar';

export default {
  name: 'AdminSidebar', // 管理员页面
  components: { Sidebar },
  computed: {
    activeIndex() { return this.$route.path.split('/')[2] || this.$rp.ANNOUNCEMENTS; },
  },
};
</script>

<style></style>
